/*
 * myqueue.h
 *
 *  Created on: Jan 18, 2014
 *      Author: yosef
 */

#ifndef MYQUEUE_H_
#define MYQUEUE_H_

class MyOwnQueue
{
private:
	// Queue memory segment
	void *queuesegment;
	// Size of queue item
	unsigned char size;
	// Available space
	unsigned int avil_space;
	// Queue tail
	unsigned int tail;

public:
	// Constructor of class
	MyOwnQueue() : queuesegment(NULL), size(0), avil_space(0), tail(0)
	{/* Empty body. */}

	~MyOwnQueue()
	{
		free(queuesegment);
	}

	// Create Queue
	int Create(unsigned int QueueLength, unsigned int QueueSize);

	// Send Queue
	int Send(const void *QueueItem);

	// Receive Queue
	int Receive(void *QueueItem);

	// Delete Queue
	void Delete(void);
};




#endif /* MYQUEUE_H_ */
